var ajaxSearching = false;
function ajaxSearchFood(){
	if(ajaxSearching){
		alert("正在搜索,请稍后再试!");
		return;
	}
	ajaxSearching = true;
	var gid = jQuery('#foodType').val();
	var sid = jQuery('#shopType').val();
	var fname = jQuery('#foodName').val();
	jQuery.ajax({
		url:'/food/i/ajaxSearch.do',
		data:{gid:gid,sid:sid,fname:fname},
		dataType:'text',
		type:'get',
		success:function(data){
			if(data){
				jQuery('#searchFoodResultDiv').html(data);
			}else{
				alert('服务器内部错误,请稍后再试!');
			}
			ajaxSearching = false;
		},
		error:function(){
			ajaxSearching = false;
		}
	});
}

jQuery(function(){
	jQuery('#searchImg').click(ajaxSearchFood);
});